package com;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.view.Gravity;
import android.widget.TextView;
import com.dev.GUI;
import com.dev.MainActivity;

public class TextMore extends TextView {
        public int paddingLeft=9;
        public TextMore(MainActivity ma){
            super(ma);
            setGravity(Gravity.CENTER_VERTICAL);
            setBackground(new GUI.Pressed());
            setTextColor(0xff000000);
        }

        @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
            int mh=getMeasuredHeight();
            setPadding(paddingLeft,0,mh,0);
        }

        @Override
        protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            int vh=getHeight();
            int vw=getWidth();
            int width=vh*38/100;
            int height=vh*28/100;
            Path path=new Path();
            int left=vw-vh+(vh-width)/2;
            int top=(vh-height)/2;
            int xcen=vw-vh/2;
            path.moveTo(left,top);
            path.lineTo(left+width,top);
            path.lineTo(xcen,top+height);
            path.close();
            Paint p=new Paint();
            canvas.drawPath(path,p);
        }
    }
